﻿<UserControl x:Class="VkClientIM.UI.AudioPlayer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Name="root">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="..\Resources\ListView.xaml"/>
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>
		<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="20"/>
			<RowDefinition Height="20"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		<Border Grid.Row="0" Margin="0,0,0,0" Background="LightBlue">
			<TextBlock Text="Аудиоплеер" TextAlignment="Center" />
		</Border>
		<Grid Grid.Row="1" Name="mediaRoot">
			<ProgressBar Value="{Binding ElementName=root,Path=PlayProgress}"/>
		</Grid>
		<Grid Grid.Row="2">
			<ListView Name="playlist" ScrollViewer.HorizontalScrollBarVisibility="Hidden"  DataContext="{Binding Items}" ItemsSource="{Binding}" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
              IsSynchronizedWithCurrentItem="True" SelectionMode="Single" SelectionChanged="playlist_SelectionChanged">
				<ListView.ItemTemplate>
					<DataTemplate>
						<Border>
						<StackPanel Orientation="Horizontal" Margin="2,2,2,2">
							<TextBlock Text="{Binding Path=Artist, Mode=OneWay}" FontWeight="Bold"/>
								<TextBlock Text=" - "/>
							<TextBlock Text="{Binding Path=Name, Mode=OneWay}"/>
						</StackPanel>
						</Border>
					</DataTemplate>
				</ListView.ItemTemplate>
				<ListView.ItemContainerStyle>
					<Style BasedOn="{StaticResource MyListViewItem}" TargetType="{x:Type ListViewItem}">
						<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
					</Style>
				</ListView.ItemContainerStyle>
			</ListView>
		</Grid>
	</Grid>
</UserControl>
